home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / delete.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  1.0 KB  |  38 lines  |  [TEXT/ttxt]

  1. #
  2. # Check for problems with delete
  3. #
  4.  
  5. drop table if exists t1;
  6. CREATE TABLE t1 (a tinyint(3), b tinyint(5));
  7. INSERT INTO t1 VALUES (1,1);
  8. INSERT LOW_PRIORITY INTO t1 VALUES (1,2);
  9. INSERT INTO t1 VALUES (1,3);
  10. DELETE from t1 where a=1 limit 1;
  11. DELETE LOW_PRIORITY from t1 where a=1;
  12.  
  13. INSERT INTO t1 VALUES (1,1);
  14. DELETE from t1;
  15. LOCK TABLE t1 write;
  16. INSERT INTO t1 VALUES (1,2);
  17. DELETE from t1;
  18. UNLOCK TABLES;
  19. INSERT INTO t1 VALUES (1,2);
  20. SET AUTOCOMMIT=0;
  21. DELETE from t1;
  22. SET AUTOCOMMIT=1;
  23. drop table t1;
  24.  
  25. #
  26. # Test of delete when the delete will cause a node to disappear and reappear
  27. # (This assumes a block size of 1024)
  28. #
  29.  
  30. create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
  31. insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
  32. delete from t1 where a=26;
  33. drop table t1;
  34. create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
  35. insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
  36. delete from t1 where a=27;
  37. drop table t1;
  38.